<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <script src="../lib/vue.js"></script>
  </head>

  <body>
    <div id="app">
      <my_cpn></my_cpn>
    </div>
    <script>
      // 1. 创建组件构造器对象
      const cpnC = Vue.extend({
        template: `<div>
        <h2>我是标题</h2>
        <p>我是内容123123123</p>
        </div>`
      })
      //2.注册组件
      //Vue.component('组件的标签名','组件构造器的名称')
      Vue.component('my_cpn', cpnC)
      //3.在页面中使用
      // <my_cpn></my_cpn>

      var vm = new Vue({
        el: '#app',
        data: {},
        methods: {}
      })
    </script>
  </body>
</html>
